'use strict'



function btn_login(){
    console.log('点击了登录');


   let username= $('[name=username]').val();
   let password= $('[name=password]').val();

   
    
    let obj={
        username,
        password
    }

    console.log(obj);


    $.post('http://localhost:3000/login',obj,(res)=>{
        console.log(obj);
        console.log(res);
        if(res==='登录成功'){
            window.location.href='./index.html'
        }else{
            alert('用户名或密码有误！')
        }

    })

}
